Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

27
Views
"Required request body is missing: public org.springframework.http.ResponseEntity

I'm learning Spring-Boot features and also reviewing them with Postman. But when I run the code, I get a 400 bad request error in Postman like this: "Required request body is missing: public org.springframework.http.ResponseEntity." Have I missed any attributes or is the encoding completely wrong?

 @RestController
 @RequestMapping("/api/board")
 @CrossOrigin
public class ProjectTaskController {

@Autowired
private ProjectTaskService projectTaskService;

@PostMapping("")
public ResponseEntity<?> addPTToBoard( @Valid @RequestBody ProjectTask projectTask, BindingResult result){
 if(result.hasErrors()) {
 Map<String, String> errorMap= new HashMap<>();

 for(FieldError error: result.getFieldErrors()) {
 errorMap.put(error.getField(), error.getDefaultMessage());
 }
 return new ResponseEntity<Map<String, String>>(errorMap, HttpStatus.BAD_REQUEST);
 }

 ProjectTask newPT= projectTaskService.saveOrUpdateProjectTask(projectTask);
 return new ResponseEntity<ProjectTask>(newPT, HttpStatus.CREATED);
}

The projectTask code also has getters and setters.

 @Entity
public class ProjectTask {

@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private long id;

@NotBlank(message = "summary cannot be blank")
private String summary;
private String acceptanceCriteria;
private String status;

public ProjectTask() {

}
over 2 years ago · Carlos Garzón Colorado
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!